package com.jcz.daoImpl;

import org.hibernate.Session;

import com.jcz.dao.A_usersDao;
import com.jcz.dao.HibernateUtil;
import com.jcz.entity.A_users;

public class A_usersDaoImpl implements A_usersDao {

	public A_users login(A_users users) {
		Session session=null;
		A_users us=null;
		try {
			session=HibernateUtil.currentSession();
			
			us=(A_users)session.createQuery("select u from A_users u "+"where u.auser=:auser and u.apwd=:apwd")
					.setParameter("auser", users.getAuser())
					.setParameter("apwd", users.getApwd())				
					.uniqueResult();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return us;
	}

}
